package com.shigen.demo.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class MyCommandLineRunner implements CommandLineRunner, Ordered {

  @Override
  public void run(String... args) {
    log.info("MyCommandLineRunner 优先级最高方法的代码输出");
  }

  /**
   * order的值越大，优先级越低
   * @return
   */
  @Override
  public int getOrder() {
    return Integer.MIN_VALUE + 1;
  }
}
